/**
 * Baijiahulian.com Inc. Copyright (c) 2014-2016 All Rights Reserved.
 */
package com.baijia.dao;

import com.baijia.dao.po.User;

import org.springframework.dao.DataAccessException;

/**
 * @title UserDao
 * @desc TODO
 * @author macrohuang
 * @date Jan 19, 2016
 * @version 1.0
 */
public interface UserDao extends CommonDao<User, Long> {
    /**
     * 通过手机号获取用户信息
     * 
     * @param mobile
     * @return
     */
    User getUserByMobile(String mobile) throws DataAccessException;

    /**
     * 根据手机号修改用户密码
     * 
     * @param mobile
     * @param newPassword
     * @return
     */
    int updatePwdByMobile(String mobile, String newPassword);

    long save(User user);

    int updateNumber(long lastInsertId, long number);

    int update(User user);

    int updateMobileById(String mobile, Long userId);

    long getIdByNumber(Long number);
}